﻿
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class SepiaEffectData : EffectOneSourceData
    {
        private float intensity=0.5f;
        private CanvasAlphaMode alphaMode;

        
        public CanvasAlphaMode AlphaMode { get => alphaMode; set { alphaMode = value; OnPropertyChanged(); SetIsChanges(); } }

        public float Intensity { get => intensity; set { intensity = value; OnPropertyChanged(); SetIsChanges(); } }

        #region 属性

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;
            var se = new SepiaEffect();
            var effect = new SepiaEffect()
            {
                Source = source,
                AlphaMode = AlphaMode,
                Intensity = Intensity,
            };
            return effect;
        }


    }
}